package mybbs;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;

public class ChildForumBean {
	private int sortid;
	public ChildForumBean(int id){sortid=id;}
	public List getChildForums() throws Exception {
		DBConn conn = new DBConn();
		List list = new ArrayList();
		String sql="SELECT * FROM forums WHERE isparent=0 AND sortid="+sortid;;
		try {
			ResultSet rs=conn.query(sql);
			while (rs.next()) 
			{  ForumInfo FT =new ForumInfo();
				FT.setForumid(rs.getInt("id"));
				list.add(FT);
			}
			conn.DBclose();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
			return list;
		}
	}
